package erfgame.core.j3d;

import javax.media.j3d.BranchGroup;

import com.sun.j3d.utils.geometry.ColorCube;

public class ColorCubeBranchGroupFactory implements BranchGroupFactory {

	private double size;
	
	public ColorCubeBranchGroupFactory( double size ) {
		this.size = size;
	}
	
	@Override
	public BranchGroup createBranchGroup() {
		ColorCube cube = new ColorCube(size);
		
		BranchGroup root = new BranchGroup();
		root.setBoundsAutoCompute(true);
		root.addChild(cube);
		
		return root;
	}

}
